﻿using DataTransfer.SDK.Models;

namespace DataTransfer.Core.Domains
{
    /// <summary>
    /// 导出字段
    /// </summary>
    public class ExcelExportSheetField : IExcelExportSheetField
    {
        /// <summary>
        /// 字段名
        /// </summary>
        public string FieldName
        {
            get;
            set;
        }
        /// <summary>
        /// 字段显示名
        /// </summary>
        public string DisplayName
        {
            get;
            set;
        }
        /// <summary>
        /// 字段类型
        /// </summary>
        public string TypeName
        {
            get;
            set;
        } = "System.String";
        Type _type;
        /// <summary>
        /// 
        /// </summary>
        public Type Type
        {
            get 
            { 
                if (_type == null)
                {
                    _type = Type.GetType(TypeName, true, true);
                }
                return _type; 
            }
        }
        /// <summary>
        /// 
        /// </summary>
        public int Width
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public int HeaderFontSize
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public int FontSize
        {
            get;
            set;
        }

        /// <summary>
        /// 
        /// </summary>
        public string Format
        {
            get;
            set;
        }
    }

}
